#ifndef UNITCONVERT_H
#define UNITCONVERT_H
#include <cmath>
#include <complex>
#include <iostream>
#include <cstdio>
#include "./Constants.h"
//单位转换
namespace UnitConvert{
    double LengthAU(double lengthSI){                 //inputUnit: nm         
        return lengthSI / 0.052917721067;          
    }
    double TimeAU(double timeSI){                      //inputUnit: fs
        return timeSI / 0.02418884326;
    }
    double InitialDensityAU(double InitialDensitySI){   //inputUnit: cm^-3
        return InitialDensitySI * 1.481704042824064e-25;
    }
    double KerrAU(double KerrSI){                       //inputUnit: cm^2/W
        return KerrSI * 6.437440519317778e15;
    }
    double ElectricAU(double laserIntensity){           //inputUnit: W/cm^2
        double intensityAU = 6.437440519317778e15;
        return std::sqrt((8 * M_PI * laserIntensity)/(intensityAU * Constants::c)) ;
    }

    double LengthSI(double lengthAU){                 //outputUnit: nm
        return lengthAU * 0.052917721067;
    }
    double TimeSI(double timeAU){                      //outputUnit: fs
        return timeAU * 0.02418884326;
    }
    
}

#endif